package com.xiong.excel.extmodel;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Workbook;

public class CellValueModel {

    private Cell cell;

    private Workbook workbook;

    private String headerValue;

    private Object value;

    public Cell getCell(){
        return this.cell;
    }

    public String getHeaderValue(){
        return this.headerValue;
    }

    public Object getValue(){
        return this.value;
    }

    public CellStyle createCellStyle(){
        if(workbook!=null){
            CellStyle cellStyle=workbook.createCellStyle();
            cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
            return cellStyle;
        }
        return null;
    }

    public CellValueModel(Cell cell, Workbook workbook,String headerValue,Object value) {
        this.cell = cell;
        this.workbook = workbook;
        this.headerValue=headerValue;
        this.value=value;
    }
}
